package global

import (
	"github.com/go-kratos/kratos/v2/log"
	"github.com/jiushengTech/common/broker"
	"github.com/panjf2000/ants/v2"
	"github.com/redis/go-redis/v9"
	"github.com/sony/sonyflake"
	"github.com/spf13/viper"
	clientv3 "go.etcd.io/etcd/client/v3"
	"gorm.io/gorm"
	"sync"
	"transfer-service/internal/conf"
)

type Etcd struct {
	Client  *clientv3.Client
	Kv      clientv3.KV
	Lease   clientv3.Lease
	Watcher clientv3.Watcher
}

// 句柄
var (
	LOG      *log.Helper //全局log
	ETCD     *Etcd
	DB       *gorm.DB
	REDIS    *redis.Client
	VP       *viper.Viper
	MQ       broker.Broker
	APOOL    *ants.Pool
	MQTTList *sync.Map
)

// 环境变量
var (
	BC *conf.Bootstrap
	SC *sonyflake.Settings
	LC *conf.LocalConfig
)
